#用于监控服务是否停止，若停止，则邮件提醒或者短信提醒
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin

export PATH

echo -e "The www, ftp, ssh and will be detect! \n"

# www listen
test=$(netstat -tuln | grep ":80")
if [ "$test" == "" ]; then
	echo "WWW do not run"
fi

# FTP Listen
test=$(netstat -tuln | grep ":21")
if [ "$test" == "" ]; then
	echo "FTP do not run"
fi

# SSH Listen
test=$(netstat -tuln | grep ":22")
if [ "$test" == "" ]; then
	echo "SSH do not run"
fi
